package com.bytedance.touch.message

import com.korion.channel.ChannelListener
import com.korion.channel.Client
import com.korion.channel.IChannel


class ChannelManager private constructor() {

    private var mChannel: IChannel? = null

    companion object{
        val INSTANCE by lazy(LazyThreadSafetyMode.NONE) {
            ChannelManager()
        }
    }

    fun init(host: String, port: Int, listener: ChannelListener){
        mChannel = Client.connect(host, port, listener)
    }

    fun getChannel(): IChannel?{
        return mChannel
    }

}